(in-package :mp3-server-system)

(defpackage :com.yanbo.macro-utilities
  (:use :common-lisp )
  (:nicknames :macro-utilities)
  (:export :with-gensyms
	   :once-only))

(defpackage :com.yanbo.binary
  (:use :common-lisp :macro-utilities)
  (:nicknames :binary)
  (:export :define-binary-class
	   :define-tagged-binary-class
	   :read-value
	   :write-value
	   :*in-rogress-objects*
	   :parent-of-type
	   :current-binary-object
	   :+null+
	   :define-binary-type
	   :read-object))

(defpackage :com.yanbo.mp3-server
  (:use :common-lisp)
  (:nicknames :mp3-server))

(defpackage :com.yanbo.pathnames
  (:use :common-lisp)
  (:nicknames :pathnames)
  (:export
   #:list-directory
   #:file-exist-p
   #:directory-pathname-p
   #:file-pathname-p
   #:pathname-as-directory
   #:pathname-as-file
   #:walk-directory
   #:directory-p
   #:file-p))

(defpackage :com.yanbo.id3v2
  (:use :common-lisp
	:com.yanbo.binary
	:com.yanbo.pathnames)
  (:import-from :com.yanbo.binary :define-binary-type :define-binary-class)
  (:import-from :common-lisp-user :in-package)
  ;(:shadowing-import :define-binary-type :com.yanbo.binary)
  (:nicknames :id3v2)
  (:export
   :read-id3
   :mp3-p
   :id3-p
   :album
   :composer
   :genre
   :encoding-program
   :artist
   :part-of-set
   :track
   :song
   :year
   :size
   :translated-genre
   :show-tag-header
   :show-tag-headers
   :count-version
   :frame-types
   :frame-types-in-dir
   :frame-id
   :find-frame-class))

(defpackage :com.yanbo.mp3-database
  (:use :common-lisp
	:com.yanbo.pathnames
	:com.yanbo.macro-utilities
	:com.yanbo.id3v2)
  (:export :*default-table-size*
	   :*mp3-schema*
	   :*mp3s*
	   :column
	   :column-value
	   :delete-all-rows
	   :delete-rows
	   :do-rows
	   :extract-schema
	   :in
	   :insert-row
	   :load-database
	   :make-column
	   :make-schema
	   :map-rows
	   :matching
	   :not-nullable
	   :nth-row
	   :random-selection
	   :schema
	   :select
	   :shuffle-table
	   :sort-rows
	   :table
	   :table-size
	   :with-column-values))

(defpackage :com.yanbo.shoutcast
  (:use :common-lisp
        :com.yanbo.id3v2)
  (:nicknames #:shoutcast)
  (:export :song
           :file
           :title
           :id3-size
	   :find-song-source
           :current-song
	   :still-current-p
           :maybe-move-to-next-song
           :*song-source-type*))
